<!--{include(file='head.html')}-->
<div id="wrap">
	<!--{include('left.html')}-->
	<div id="maincont">
		<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
		<div id="main_c" >
			<form name="seaform" id="seaform" action="" method="post">
				<div class="bt_bk">
					<span class="btn">
						<a href="javascript:void(0);" onclick="$.oper.refresh();return false;">刷新</a>
						<a href="javascript:void(0);" onclick="$.oper.cdelete();return false;">删除</a>
						<a href="<!--{url('admin','spec','specadd')}-->">添加</a>
					</span>
					<span class="state_oper">
						快速添加：
						<a href="javascript:void(0);" onclick="addspec(1);return false;">颜色(服装-鞋帽)</a>
						<a href="javascript:void(0);" onclick="addspec(2);return false;">尺码(服装)</a>
						<a href="javascript:void(0);" onclick="addspec(3);return false;">尺码(男士鞋类)</a>
						<a href="javascript:void(0);" onclick="addspec(4);return false;">尺码(女士鞋类)</a>
						<a href="javascript:void(0);" onclick="addspec(5);return false;">尺码(儿童鞋类)</a>
					</span>
				</div>
			</form>
			
			<table class="tableStyle" border="0" cellspacing="0" cellpadding="0">
				<thead>
					<tr align="center">
						<th width="10%">
							<input type="checkbox" value="1" name="allselect" id="allselect" autocomplete="off" onclick="$.oper.selectall()"/>
						</th>
						<th width="10%">操作</th>
						<th width="10%">名称</th>
						<th width="10%">备注</th>
						<th width="60%">规格值</th>
					</tr>
				</thead>
				<tbody id="listtbody">
					<!--{foreach $speclist spec}-->
					<tr align="center" id="tr_<!--{$spec.specid}-->">
						<td><input type="checkbox" value="<!--{$spec.specid}-->" name="singleselect" autocomplete="off"/></td>
						<td>
							<a href="<!--{url('admin','spec','specedit','specid=$spec.specid')}-->" class="edit"></a>
							<a href="javascript:void(0);" onclick="$.oper.cdelete('<!--{$spec.specid}-->');return false;" class="del"></a>
						</td>
						<td><!--{$spec.name}--></td>
						<td><!--{$spec.memo}--></td>
						<td>
							<!--{if $spec.vals}-->
								<!--{implode(",",$spec['vals'])}-->
							<!--{/if}-->
						</td>	
					</tr>
					<!--{/foreach}-->
				</tbody>
			</table>
		</div>
		<b class="b4b"></b><b class="b3b"></b><b class="b2b"></b><b class="b1b"></b>
	</div>
</div>
<!--{include(file='foot.html')}-->
<script type="text/javascript">
$(function(){
	$.oper.init("<!--{url('admin','spec','specsave')}-->");
});
function addspec(type) {
	var url = "<!--{url('admin','spec','qspecadd')}-->";
	$.post(url,{type:type},function(data){
		if(data == "success") {
			window.location.reload();
		} else {
			jAlert("发生错误,请刷新页面后重新执行该操作","警告");
		}
	});
}
</script>